swpr=zi.sweepModule();
%%

swpr.setControl('gridnode',  'oscs/0/freq', 'start', 257.85, 'stop', 258.25, 'samplecount', 10);
swpr.setFilter('bandwidthcontrol', 1, 'bandwidth', 200.0, 'order', 8);
swpr.setSettling('settling_time', 0.01);
swpr.setStatistics('averaging_sample', 100);

swpr.reset();
swpr.subscribeChannel('1', {'phase', 'r'});
swpr.subscribeChannel('2', {'x', 'r'});
swpr_data = swpr.run();
swpr.unsubscribeChannel();


%%
figure('Name', 'Sweeper data');
rp = swpr_data.getNodeData('1', {'r', 'phase'});
plot(rp.grid, rp.value)
legend(rp.label)